package com.spring.shopping.entity;

import java.math.BigDecimal;
import java.util.Date;

/*
 * @Coding By ZTK:
 */
public class Product {
    private Integer id;
    private Integer userId;
    private String name;
    private String description;
    private BigDecimal price;
    private String category;
    private String imagePath;
    private Integer status; // 1-上架, 0-下架
    private Date createdTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getPrice() {
        return price.doubleValue();
    }

    public void setPrice(Double price) {
        this.price = new BigDecimal(price);
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getImagePath() {
        return imagePath;
    }

    public void setImagePath(String imagePath) {
        this.imagePath = imagePath;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", userId=" + userId +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", price=" + price +
                ", category='" + category + '\'' +
                ", imagePath='" + imagePath + '\'' +
                ", status=" + status +
                ", createdTime=" + createdTime +
                '}';
    }
}